<template>
    <div>
        <!-- 按钮 -->
        <el-row>
            <el-button>默认按钮</el-button>
            <el-button type="primary">主要按钮</el-button>
            <el-button type="success">成功按钮</el-button>
            <el-button type="info">信息按钮</el-button>
            <el-button type="warning">警告按钮</el-button>
            <el-button type="danger">危险按钮</el-button>

            <el-button type="primary" icon="el-icon-user" circle></el-button>
            <el-button type="primary" icon="el-icon-search">搜索</el-button>
            <el-button type="primary" size="small">上传<i class="el-icon-upload el-icon--right"></i></el-button>
        </el-row>

        <!-- 布局 -->
        <el-row>
            <el-col :span="6">
                <div class="grid-content bg-purple"></div>
            </el-col>
            <el-col :span="6">
                <div class="grid-content bg-purple-light"></div>
            </el-col>
            <el-col :span="12">
                <div class="grid-content bg-purple"></div>
            </el-col>
        </el-row>

        <!-- 表单 -->
        <el-input v-model="username" placeholder="请输入内容"></el-input>

        <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="审批人">
                <el-input v-model="formInline.user" placeholder="审批人"></el-input>
            </el-form-item>
            <el-form-item label="活动区域">
                <el-select v-model="formInline.region" placeholder="活动区域">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSubmit">查询</el-button>
            </el-form-item>
        </el-form>
        <hr>

        <!-- 日期选择器 -->
        <el-date-picker v-model="birthday" type="date" placeholder="选择日期">
        </el-date-picker>

        <!-- 开关 -->
        <el-switch v-model="flag" @change="updateState">
        </el-switch>
    </div>
</template>

<script>
export default {
    data() {
        return {
            username: '',
            formInline: {
                user: '',
                region: ''
            },
            birthday: null,
            flag:false
        }
    },
    methods: {
        onSubmit() {
            console.log('submit!');
        },
        updateState(){
            console.log(this.flag)
        }
    }
}
</script>

<style lang="less" scoped>
.el-row {
    margin-bottom: 20px;

    &:last-child {
        margin-bottom: 0;
    }
}

.el-col {
    border-radius: 4px;
}

.bg-purple-dark {
    background: #99a9bf;
}

.bg-purple {
    background: #d3dce6;
}

.bg-purple-light {
    background: #e5e9f2;
}

.grid-content {
    border-radius: 4px;
    min-height: 36px;
}

.row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
}
</style>    